package com.zhanghe.study.springcloudalibaba.controller;

import com.zhanghe.study.springcloudalibaba.model.Order;
import com.zhanghe.study.springcloudalibaba.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zh
 * @date 2021/9/15 15:17
 */
@RestController
@RequestMapping("/order")
public class OderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/create")
    public String create(@RequestBody Order order){

        orderService.create(order);
        return "订单完成";
    }
}
